import turtle
import math
turtle.register_shape("1.gif")
turtle.register_shape("2.gif")
Issac = turtle.Turtle("2.gif")
lilith = turtle.Turtle("1.gif")
bean=turtle.Turtle("circle")
bean.goto(-200,200)

Issac.forward(300)
lilith.forward(100)

#turtle.hideturtle()
#turtle.tracer(False)
def moveRight():
    print("d pressed:")
    dist=distance(lilith.pos(),bean.pos())
    print(dist)
    lilith.forward(50)
def moveUp():
    print("w pressed:")
    lilith.left(90)
    lilith.forward(50)
def IssacMoveRight():
    print("6 pressed:")
    Issac.forward(50)

def IssacMoveLeft():
    print("4 pressed:")
    Issac.left(180)
    Issac.forward(50)
def distance(co1, co2):
    return math.sqrt(pow(abs(co1[0]-co2[0]),2 ) + pow(abs(co1[1]-co2[1]), 2))

turtle.listen()
turtle.onkeypress(moveRight,"d" )
turtle.onkeypress(moveUp,"w")
turtle.onkeypress(IssacMoveRight,"6")
turtle.onkeypress(IssacMoveLeft,"4")



turtle.done()